package com.hjy.springbootinit.api;

import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONUtil;

import java.util.HashMap;

/**
 * @version 1.0
 * @Author HJY_Maker
 * @Date 2024/5/15 星期三 9:52
 */
public class CreateChatToOpenAI {
    public static void main(String[] args) {
        String url = "hhhhh";
        HashMap<String, Object> hashMap = new HashMap<>();
        hashMap.put("message","用户的消息，请帮我分析");
        String jsonStr = JSONUtil.toJsonStr(hashMap);
        String result = HttpRequest.post(url)
                .header("Authorization", "Bearer 替换为自己的key")
                .body(jsonStr)
                .execute()
                .body();
    }
    //得到的结果大概是

}
